<?php

require_once __DIR__.'/kyoSmarty.class.php';
require_once __DIR__.'/Db.class.php';

$db = Db::getInstance([
    'host' => '127.0.0.1',
    'port' => '3306',
    'username' => 'root',
    'password' => '123123',
    'dbname' => 'blog',
    'socket' => '/var/run/mysqld/mysqld.sock'
]);
$data = $db->query('select * from test');
$smarty = kyoSmarty::getInstance();

$smarty->assign('title', "Smarty Template!");
$smarty->assign('data', $data);
$smarty->display('index.tpl');
// $file = file_get_contents('./temp/templates/index.tpl');
// $smarty->display('string:'.$file);
